home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / maestro / source / dtr / dtr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-15  |  18.4 KB  |  624 lines

  1. /*
  2.  * Copyright (c) 1990, 1991 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, and distribute this software and 
  5.  * its documentation for any purpose is hereby granted without fee, provided
  6.  * that (i) the above copyright notices and this permission notice appear in
  7.  * all copies of the software and related documentation, and (ii) the name
  8.  * Stanford may not be used in any advertising or publicity relating to
  9.  * the software without the specific, prior written permission of
  10.  * Stanford.
  11.  * 
  12.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
  13.  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
  14.  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
  15.  *
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
  17.  * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
  18.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT
  19.  * ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY,
  20.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  21.  * SOFTWARE.
  22.  */
  23.  
  24. /* $Header: /Source/Media/collab/DTR/RCS/dtr.h,v 1.11 92/05/29 12:42:11 drapeau Exp $ */
  25. /* $Log:    dtr.h,v $
  26.  * Revision 1.11  92/05/29  12:42:11  drapeau
  27.  * Modified code to track new name of the MAEstro "Selection" structure;
  28.  * it is now named "MAESelection".
  29.  * 
  30.  * Revision 1.10  92/01/09  12:41:36  drapeau
  31.  * Slight modifications to the code to make it ANSI-compliant.
  32.  * 
  33.  * Revision 1.0  92/01/06  17:47:11  drapeau
  34.  * Made a number of cosmetic changes to make code easier to read and
  35.  * to conform to programming specifications.
  36.  * 
  37.  * Revision 0.32  91/09/30  16:13:25  derek
  38.  * DTR will now disconnect from the Port Manager when it quits.  Also,
  39.  * a number of printf statements are removed.
  40.  * 
  41.  * Revision 0.31  91/09/18  22:47:46  derek
  42.  * The following things are done:
  43.  * 1.    The Makefile is changed corresponding to the changes in collab/.
  44.  * 2.    Copyright messages included.
  45.  * 3.    Some minor bugs fixed.
  46.  * 
  47.  * Revision 0.30  91/08/27  18:06:17  derek
  48.  * The SizeToFit bug is fixed.
  49.  * 
  50.  * Revision 0.29  91/08/27  17:22:55  derek
  51.  * The zooming bug is fixed in this version.
  52.  * 
  53.  * Revision 0.28  91/08/22  13:10:13  derek
  54.  * I have added GetAppIcon().
  55.  * 
  56.  * Revision 0.27  91/08/21  11:34:36  derek
  57.  * The following changes are made:
  58.  * 1.    Now the duration and size of the recorded sound will be displayed
  59.  *     during recording.
  60.  * 2.    I have changed GetSelection() corresponding to the request of Tek joo
  61.  * 3.    Info Panel is added to the application.
  62.  * 4.    Fixed SizeToFitHandler() so that when no file or buffer is currently
  63.  *     loaded, it would not do anything (except giving a warning
  64.  *     notice_prompt).
  65.  * 5.    Inplemented the `Close' Menu option in the document menu.
  66.  * 6.    Fixed the bug in which after ClearAll and I press PreviewEdit,
  67.  *     the edit wont be played.
  68.  * 7.    I have made the changes corresponding to the change in OpenPanel's
  69.  *     name.  (from OpenPanel to Browse).
  70.  * 8.    Incorporated BrowseCheck to check command line arg.
  71.  * 9.    Changed most EditingStatusMessages to NoticePrompts.
  72.  * 10.    SoundFileSaveAsPopUp and EditListSaveAsPopUp are removed 
  73.  *     from the application.
  74.  * 
  75.  * Revision 0.26  91/08/16  18:10:59  derek
  76.  * 
  77.  * The following things are done:
  78.  * 1.    I have fixed an openpanel bug in my code in which I 
  79.  *     made the app return the wrong values to OpenHandler and
  80.  *     the SaveHandler.
  81.  * 2.    The flashing color of the play button has been changed from
  82.  *     Red to Green.
  83.  * 3.    Fixed a quantization bug: Buffer.play.end, when converted
  84.  *     from endingTimeInSec, should not exceed Buffer_hdr_data_size - 1.
  85.  * 
  86.  * Revision 0.25  91/08/14  16:14:23  derek
  87.  * Fixed a few saving/appending bugs.
  88.  * 
  89.  * Revision 0.24  91/08/13  20:38:45  derek
  90.  * The buttons (play, pause, record) will now flash after they are pressed.
  91.  * This only applies to times when audio files (not edit-lists) are 
  92.  * played.
  93.  * 
  94.  * Revision 0.23  91/08/08  11:02:29  derek
  95.  * This is a cleaner version.  I have removed lots of printf/fprintf 
  96.  * statements from it, and have also cleaned up the code using xsaber.
  97.  * This version should run substantially faster.
  98.  * 
  99.  * Revision 0.22  91/08/07  16:25:00  derek
  100.  * The Edit list part of DTR is done.  OpenPanel is also incorporated.
  101.  * 
  102.  * Revision 0.21  91/08/06  12:42:16  derek
  103.  * Edit list panel is done.  Still need to link it to the network code.
  104.  * 
  105.  * Revision 0.20  91/07/31  14:51:13  derek
  106.  * I have changed the user interface so that text fields like size and
  107.  * duration will be displayed in normal (not bold) format.   I also fixed
  108.  * a network bug.  In addition, I have added a routine to check how
  109.  * much disk space is left in /usr/tmp.
  110.  * 
  111.  * Revision 0.19  91/07/30  11:45:55  derek
  112.  * I have fixed the tmp file conflict bug.
  113.  * 
  114.  * Revision 0.18  91/07/29  15:10:37  derek
  115.  * The playing w/o stopping error is fixed.
  116.  * 
  117.  * Revision 0.17  91/07/26  13:18:37  derek
  118.  * Some saving bugs fixed.
  119.  * 
  120.  * Revision 0.16  91/07/24  12:52:20  derek
  121.  * Disk editing is done.  Now the application can record sound infinitely,
  122.  * as long as there is disk space available.  Command line args are also
  123.  * supported.
  124.  * 
  125.  * Revision 0.15  91/07/23  21:25:52  derek
  126.  * This version is not ready for release.  Disk space editing is half-done:
  127.  * the application can play an infinite sound and the canvases can handle
  128.  * infinite sound files.  The app is pretty bug free too, I think.  The
  129.  * weakness is that it cannot record sond infinitely.
  130.  * 
  131.  * Revision 0.14  91/06/26  15:56:07  derek
  132.  * I have reformatted the code to conform coding specs.
  133.  * 
  134.  * Revision 0.13  91/06/25  16:34:46  derek
  135.  * The displaying of wrong pause message is fixed.
  136.  * 
  137.  * Revision 0.12  91/06/20  19:55:21  derek
  138.  * The network part should be working.  Also fixed numerous minor parts
  139.  * involving the canvas and the display.
  140.  * 
  141.  * Revision 0.11  91/06/05  14:59:30  derek
  142.  * checking in after porting the code to collab
  143.  * 
  144.  * Revision 0.10  1991/04/25  01:47:16  derek
  145.  * This version is checked in on 4/24/91
  146.  * */
  147. static char dtrHeaderRcsid[] = "$Header: /Source/Media/collab/DTR/RCS/dtr.h,v 1.11 92/05/29 12:42:11 drapeau Exp $";
  148.  
  149. #include <stdio.h>
  150. #include <sys/param.h>
  151. #include <sys/types.h>
  152. #include <xview/xview.h>
  153. #include <xview/font.h>
  154. #include <xview/panel.h>
  155. #include <xview/notice.h>
  156. #include <xview/notify.h>
  157. #include <xview/textsw.h>
  158. #include <xview/xv_xrect.h>
  159. #include <xview/scrollbar.h>
  160. #include <xview/cms.h>
  161. #include <gdd.h>
  162. #include <errno.h>
  163. #include <math.h>
  164. #include <stdlib.h>
  165. #include <fcntl.h>
  166. #include <sys/dir.h>
  167. #include <sys/file.h>
  168. #include <sys/stat.h>
  169. #include <sys/signal.h>
  170. #include <stropts.h>
  171. #include <sys/ioctl.h>
  172. #include <sys/vfs.h>
  173.  
  174. #include <multimedia/libaudio.h>
  175. #include <multimedia/audio_device.h>
  176. #include <multimedia/ulaw2linear.h>
  177.  
  178. #include <Sender.h>
  179. #include <Receiver.h>
  180.  
  181. #include <Browse.h>
  182.  
  183. /*
  184.  * Network Protocol stuff.
  185.  */
  186. extern    void        OpenDoc();
  187. extern    void        SetSelection();
  188. extern    void        PerformSelection();
  189. extern    char        **GetDoc();
  190. extern    MAESelection     *GetSelection();
  191. extern  void        HaltSelection();
  192. extern    void        PauseSelection();
  193. extern    void        ResumeSelection();
  194. extern    void        HideApplication();
  195. extern    void        ShowApplication();
  196. extern  IconData    *GetAppIcon();
  197. extern    void        InitNetwork();
  198.  
  199.  
  200. Sender         *sender;
  201. Receiver    *receiver;
  202. Port        senderPort;
  203. int        ReceiverPortNumber;
  204.  
  205. char        currentSoundFile[MAXPATHLEN];
  206.  
  207.  
  208. typedef    char    BOOL;
  209. #define    TRUE    1
  210. #define FALSE    0
  211.  
  212.  
  213. /*
  214.  * OpenPanel functions and variable.
  215.  */
  216. extern    int    OpenHandler();
  217. extern    int    SaveHandler();
  218.  
  219. #define    IS_EDITLIST    1
  220. #define    IS_SOUNDFILE    0    
  221.  
  222.  
  223.  
  224. /*
  225.  * DEBUG mode!!
  226.  */
  227. /*#define DEBUG*/
  228.  
  229. /*
  230.  * Some debugging routines.
  231.  */
  232. #ifdef DEBUG
  233. #define EVENT(P)     \
  234.   printf("Event: %s\tAP: %d\tAR: %d\tWaitFlag: %d\n", \
  235.      (P), ActiveFlag & PLAY, ActiveFlag & RECORD, \
  236.      WaitFlag)
  237. #else
  238. #define EVENT(P)
  239. #endif
  240.  
  241. #define    PERROR(msg)    fprintf(stderr, "%s(%d): \"%s\" (%s)\n",    \
  242.                 prog, __LINE__, msg, sys_errlist[errno]);
  243.  
  244. /*
  245.  * Some global variables
  246.  */
  247. char    prog[20];
  248. int    soundfd;
  249. char    msg[200];
  250. unsigned char   SndBuf[1024];                        /*  Sound buffer for holding segments of sound.     */
  251.  
  252. int    WaitFlag;                            /*  TRUE if either PLAY or RECORD.                  */
  253. int    ActiveFlag;                            /*  TRUE if either PLAY or RECORD.                  */
  254. BOOL    SoundBufferReady;
  255. BOOL    FileReady;
  256. BOOL    SameSoundFile;
  257. BOOL    BufferSaved;
  258.  
  259. #define    PLAY    1
  260. #define RECORD    2
  261.  
  262. int        Audioctl_fd;                        /*  fd for audio control device.                    */
  263. int        Audio_fd;                        /*  fd for audio i/o device.                        */
  264. int        Alert_fd;                        /*  fd for alert i/o                                */
  265. int        Sync_sched;                        /*  sigpoll_sync_handler scheduled                  */
  266. Audio_info    Audio_state;                        /*  audio device state structure                    */
  267. Audio_hdr    Device_phdr;                        /*  Play configuration info                         */
  268. Audio_hdr    Device_rhdr;                        /*  Record configuration info                       */
  269. Audio_hdr       tmpSoundHdr;
  270. int        tmpSoundFd;
  271.  
  272.  
  273. #define    MAXLENGTH        200
  274. #define AUDIO_DEV        "/dev/audio"
  275. #define AUDIO_CTLDEV        "/dev/audioctl"
  276. #define MAX_GAIN        (100)
  277. #define    MAX_RECORD_TIME        (5 * 60)                /*  Max record time in seconds                      */
  278. #define DEVICE_SAMPLE_RATE    8000
  279.  
  280. /*
  281.  * Global variables for Wave Canvas display.
  282.  */
  283. int     WaveCanvasWidth;
  284. int     WaveCanvasHeight;
  285. int     WaveWindowWidth;
  286. int     WaveWindowHeight;
  287. int     WaveCanvasMidHeight;
  288. int     WaveScopeWidth;                            /*  This is the half height of the wave.            */
  289. double  oldLeftFloatMarker;
  290. double  oldRightFloatMarker;
  291. BOOL    WaveCanvasRightMarkerSet;
  292. char    WaveCanvasInitReady;
  293. double  Zoom;
  294. int     leftButtonHoldPoint;
  295. double  WaveCanvasDataSamplingInterval;                    /*  Buffer.hdr.data_size / WaveWindowWidth          */
  296. double  DefaultWaveCanvasDataSamplingInterval;
  297. double    FrameStartingSecond;                        /*  This is the time (in second) at which the...    */
  298.                                     /*  ...window starts.                               */
  299.  
  300.  
  301. /*
  302.  * Global variables for Global Wave Canvas Display.
  303.  */
  304. int     GlobalWaveCanvasWidth;
  305. int     GlobalWaveCanvasHeight;
  306. int     GlobalWaveWindowWidth;
  307. int     GlobalWaveWindowHeight;
  308. int     GlobalWaveCanvasMidHeight;
  309. int     GlobalWaveScopeWidth;                        /*  This is the half height of the wave.            */
  310. char    GlobalWaveCanvasInitReady;
  311. double  oldLeftFloatGbWaveMarker;
  312. double  oldRightFloatGbWaveMarker;
  313. BOOL    GlobalWaveCanvasRightMarkerSet;
  314. int     GbWaveLeftButtonHoldPoint;
  315. double  GlobalWaveCanvasDataSamplingInterval;
  316.  
  317. BOOL    CanUndo;
  318.  
  319.  
  320. /*
  321.  * Global variables for recording.
  322.  */
  323. char    SoundFileInTmp[40];
  324.  
  325.  
  326. /*
  327.  * Global variables for Scale Canvas Display.
  328.  */
  329. int     ScaleWindowHeight;
  330.  
  331.  
  332. #define MAX_ZOOM  5                            /*  MAX_ZOOM is in terms of real zoom value.        */
  333. #define NOTREADY  -1
  334. #define GLOW_INTERVAL 0.5
  335.  
  336. /*
  337.  * macros for VUMeter
  338.  */
  339. #define SCOPE_WIDTH 256
  340. #define SCOPE_MASK  (SCOPE_WIDTH - 1)
  341.  
  342. struct sound_buffer {
  343.     Audio_hdr    hdr;                            /*  encoding info.                                  */
  344.     char    info[MAXLENGTH];
  345.     char    filename[MAXLENGTH];
  346.     int         headersize;                        /*  size of the header.                             */
  347.     
  348.     unsigned char    *data;                        /*  ptr to data buffer.                             */
  349.     unsigned    alloc_size;                        /*  size of data buffer.                            */
  350.     unsigned char       *olddata;                    /*  ptr to old data buffer.                         */
  351.     unsigned    old_alloc_size;                        /*  size of olddata buffer.                         */
  352.     unsigned    old_hdr_data_size;
  353.     int        hdr_size;
  354.     int        draining;
  355.     int        paused;
  356.  
  357.     struct {
  358.     time_t        modified;
  359.     struct direct    **files;
  360.     Menu        menu;
  361.     }            menu;                        /*  cached menu.                                    */
  362.  
  363.     struct {
  364.     unsigned    start;                        /*  selected region to play.                        */
  365.     unsigned    end;
  366.     unsigned    io_position;
  367.     }            play;
  368.     struct {
  369.     int    cursor_pos;                        /*  cursor position in buffer                       */
  370.     int    start;                            /*  marks selected region                           */
  371.     int    end;
  372.     int    position;
  373.     int    last;
  374.     }            display;
  375. } Buffer;
  376.  
  377.  
  378. struct cut_buffer {
  379.     unsigned    alloc_size;
  380.     unsigned char       *data;
  381. } CutBuffer;
  382.  
  383.  
  384. extern    char    *sys_errlist[];
  385.  
  386. /*
  387.  * audio.c
  388.  */
  389. extern     void       InitAudio();
  390. extern   void            InitAudioControl();
  391. extern   int            AudioOpen();
  392. extern   Notify_value    SigpollAsyncHandler();
  393. extern   Notify_value    SigpollSyncHandler();
  394. extern   BOOL            AudioReadState();
  395. extern   void            AudioUpdatePanel();
  396. extern   void            AudioFlushClose();
  397. extern   int            UnscaleGain();
  398. extern   double         ScaleGain();
  399. extern     void        SetPlayGain();
  400. extern     void        UpdateRecordingMessageDisplay();
  401.  
  402.  
  403. /*
  404.  * play.c
  405.  */
  406. extern   void            Play();
  407. extern   void            StartPlay();
  408. extern   void            PlayService();
  409. extern   void        StopPlay();
  410. extern   void            StopRecord();
  411. extern   void            PlayUpdateCursor();
  412.  
  413. /*
  414.  * buffer.c
  415.  */
  416. extern   void            InitBuffer();
  417. extern   BOOL        ReadSoundFile(BOOL intoBuffer);
  418. extern   void        FileUpdate();
  419. extern     BOOL        IsTmpSoundFile();
  420. extern     unsigned char  GetFileData();
  421.  
  422. /*
  423.  * dtrutils.c
  424.  */
  425. extern    void        Alert();
  426. extern    void        ClearStatusMessage();
  427. extern    void        ClearMessageDisplay();
  428. extern    BOOL        NullFileName();
  429. extern    void        AlertByNoticePrompt();
  430. extern    Notify_value    DestroyMainWindow();
  431. extern    void        UpdateHeader(int modified);
  432. extern    void        UpdateEditListHeader(int modified);
  433.  
  434. /*
  435.  * pause.c
  436.  */
  437. extern   void        Pause();
  438.  
  439. /*
  440.  * record.c
  441.  */
  442. extern   void        StartRecord();
  443. extern   void          RecordService();
  444. extern   void        StopRecord();
  445. extern     void        InitRecord();
  446. extern     void        RemoveSoundFileInTmp();
  447.  
  448.  
  449. /*
  450.  * save.c
  451.  */
  452. extern   int            SaveSoundFile();
  453.  
  454.  
  455. /*
  456.  * display.c
  457.  */
  458. extern   void        InitDisplay();
  459. extern   void           DisplaySoundDuration();
  460. extern   void        DisplaySoundSelectionDuration();
  461. extern   void           DisplaySoundSize();
  462. extern   void           DisplaySoundSelectionSize();
  463. extern   void        UpdateMessageDisplay();
  464. extern   void        UpdateZoomLevelDisplay();
  465. extern     void        UpdateSpaceOnTmp();
  466. extern     void        UpdateButtonGlow();
  467. extern     void        CancelButtonGlow();
  468.  
  469. int    RedColorIndex;
  470. int    BlackColorIndex;
  471. int    GreenColorIndex;
  472.  
  473.  
  474. /*
  475.  * canvas.c
  476.  */
  477. extern   void        RepaintWaveCanvas();
  478. extern   void        InitWaveCanvas();
  479. extern   void        InitScaleCanvas();
  480. extern   void        InitWaveCanvasScrollbar();
  481. extern   void           InitScaleCanvasScrollbar();
  482. extern   Notify_value   WaveCanvasScrollBarHandler();
  483. extern   void          ResetWaveCanvas();
  484. extern   void        ClearWaveCanvas();
  485. extern   void        ClearScaleCanvas();
  486. extern   void        WaveCanvasMarkerHandler();
  487. extern   void           WaveCanvasBackwardMarkerHandler();
  488. extern   unsigned long* GetColormap();
  489. extern   int         GetColorIndex();
  490. extern   void        WaveCanvasPenColor();
  491. extern     void        ScaleCanvasPenColor();
  492. extern   void        WaveCanvasRepaintHandler();
  493. extern   void        ResetWaveCanvasMarkers();
  494. extern   void           ReverseWaveCanvasArea();
  495. extern   void           UpdateCanvasesAndScrollbarParameters();
  496. extern   void           CenterWaveCanvasHighlightedSegment();
  497. extern   void        HighlightWaveCanvas();
  498. extern   void        InitVUMeterCanvas();
  499. extern   void        UpdateVUMeter();
  500. extern   void        ClearVUMeterCanvas();
  501. extern   void           VUMeterCanvasPenColor();
  502. extern   void           ResetVUMeter();
  503. extern     void        CalculateLevelAndDisplayVUMeter();
  504. extern     void        ScaleCanvasRepaintHandler();
  505.  
  506. extern   void            ClearAllSound();
  507.  
  508.  
  509. /*
  510.  * editlist.c
  511.  */
  512. #define    USER            1
  513. #define NON_USER        0
  514. #define NO_CURRENT_EDIT        -1
  515. #define DEFAULT_EDITLIST_SIZE    50
  516.  
  517. struct editList
  518. {
  519.   int       capacity;
  520.   int        numItems;
  521.   char        **soundFile;
  522.   char        **label;
  523.   int        *startingMin;
  524.   double    *startingSec;
  525.   int        *endingMin;
  526.   double    *endingSec;
  527.   int        *volume;
  528. } EditList;
  529.  
  530. extern     void        InitEditList();
  531. extern     void        ReallocateMemoryForEditList();
  532. extern     int        ReadEditListFromFile();
  533. extern     void        DeselectList();
  534. extern     int        WriteEditListToFile();
  535. extern     void        ResetCurrentSelection();
  536. extern     void        EmptyList();
  537. extern     void        UpdateNumEditsMessage();
  538. extern     void        SetCurrentSelection();
  539. extern     char        *FormatEntry();
  540. extern     void        NewEditList();
  541. extern     void        DeleteAllSelections();
  542. extern     void        RedrawEditList();
  543. extern     void        DeleteItemFromEditList();
  544. extern     void        DeleteSelection();
  545. extern     void        ModifySelection();
  546. extern     void        AddSelection();
  547. extern     void        SetEditList(char* editListName);
  548. extern     void        SetScrollListFont();
  549. extern   void           EnableEditListPanel();
  550. extern   void           DisableEditListPanel();
  551.  
  552.  
  553. BOOL     unsavedChangesExist;
  554. char     absoluteEditListName[MAXPATHLEN];
  555. int      currentSelection;                        /*  This flag indicates the current selection... */
  556.                                     /*  ...number (in the internal EditList data...  */
  557.                                     /*  ...structure.                                */
  558. BOOL     currentSelectionReadyToPlay;                    /*  This flag is set to be true after...         */
  559.                                     /*  SetCurrentSelection() is called.  If the...  */
  560.                                     /*  selection on the canvas is changed etc., ... */
  561.                                     /*  ...this flag will be set to FALSE.           */
  562.  
  563. /*
  564.  * gbcanvas.c
  565.  */
  566. extern   void        RepaintGlobalWaveCanvas();
  567. extern   void        InitGlobalWaveCanvas();
  568. extern   void          ResetGlobalWaveCanvas();
  569. extern   void        ClearGlobalWaveCanvas();
  570. extern   void        GlobalWaveCanvasMarkerHandler();
  571. extern   void           GlobalWaveCanvasBackwardMarkerHandler();
  572. extern   unsigned long* GlobalWaveCanvasGetColormap();
  573. extern   void        GlobalWaveCanvasPenColor();
  574. extern   void        GlobalWaveCanvasRepaintHandler();
  575. extern   void        ResetGlobalWaveCanvasMarkers();
  576. extern   void           ReverseGlobalWaveCanvasArea();
  577. extern   void           UpdateCanvasFrame();
  578. extern     void        DisplayCanvasFrame();
  579.  
  580.  
  581. /*
  582.  * openpanel.c
  583.  */
  584. extern     void        InitOpenPanel();
  585. extern     int        OpenHandler();
  586. extern     int        SaveHandler();
  587.  
  588. char     *documentFirstLine;
  589. char     *documentFileType;
  590.  
  591. #define    FILE_OK        0
  592. #define    FILE_NOT_OK    -1
  593.  
  594.  
  595. /*
  596.  * waveedit.c
  597.  */
  598. extern   void           WaveCutHandler();
  599. extern   void           WaveCopyHandler();
  600. extern     void        WavePasteHandler();
  601. extern   void           AllocCutBuffer();
  602. extern     void        SetWaveEditModeOn();
  603. extern     void        SetWaveEditModeOff();
  604. extern     void        InitWaveEditVariables();
  605.  
  606. BOOL              WaveEditMode;                    /*  Flag indicating whether wave-edit mode is on.   */
  607.  
  608.  
  609. /*
  610.  * timer.c
  611.  */
  612. extern   Notify_value   VUMeterTimerHandler();
  613. extern   void        SetVUMeterTimer();
  614. extern   void        CancelVUMeterTimer();
  615. extern   Notify_value   ButtonGlowTimerHandler();
  616. extern   void        SetButtonGlowTimer();
  617. extern   void        CancelButtonGlowTimer();
  618.  
  619.  
  620. /*
  621.  * dtr.c
  622.  */
  623. void    UpdateSelection();
  624.